package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Fahuo;
import cn.gson.boot.model.pojos.Hetong;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;
import java.util.List;

public interface FaHuoDao extends CrudRepository<Fahuo,Integer> {
    //移除发货 （逻辑删除）
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update fahuo set fh_ys=0 where fh_id=?1")
    public void yichuFaHuo(Integer fhId);

    //修改订单状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update fahuo set fh_zhuangtai=?1 where fh_id=?2")
    public void updateFaHuoZt(String  zt,Integer fhId);
}
